package com.testmanager.testmananger.shuiyou.common.Constant;

import com.testmanager.testmananger.foundation.domain.enums.EnumBase;

import java.util.Arrays;

public enum SqlEnv implements EnumBase {
    JUFAN("局端",1),YUNDUAN("云端",2);
   // private final String code;
    private final String name;
    private final int value;

    SqlEnv(String name,int value){
      //  this.code =code;
        this.name=name;
        this.value=value;
    }

    public static SqlEnv getValueOf(int value){
        return Arrays.stream(SqlEnv.values()).
                filter(t->t.getValue().equals(value))
                .findFirst()
                .orElse(SqlEnv.YUNDUAN);
    }


    @Override
    public String getName() {
        return name;
    }

    @Override
    public Integer getValue() {
        return value;
    }
}
